package stuV;

import java.util.ArrayList;

public class Student {
	
	//Atributes 
	private int id;
	private String name;
	private ArrayList<Note> noten = new ArrayList<Note>();
	
	//Getter & Setter
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
		if(isValid(id) == true){
			this.id = id;
		}
		else {
			System.out.println("Die ID muss zwischen 10000 und 99999 liegen!");
		}
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	//Methods
	
	private boolean isValid(int id){
		if(id<=10000 && id>=99999){
			return true;
		}
		else {
			return false;
		}	
	}
	
	public void datenAusgeben(){
		System.out.println("Martikelnummer: " + this.getId() + "Name: " + this.getName());
	}
	
	public void  addNote(Note note){
		this.noten.add(note);
		
	}
	
}
